<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: HTMLPortlet.php 402 2011-01-04 21:18:51Z steen.rabol $
 * @package Pradoportal.Portlets.HTMLPortlet
 */

Prado::using('Application.Portlets.Portlet');
Prado::using('Application.Portlets.HTMLPortlet.Common.HTMLPortletRecord');

class HTMLPortlet extends Portlet
{
	public function onLoad($p)
	{
		parent::onLoad($p);

		$this->PortletRecord = HTMLPortletRecord::finder()->findByPk($this->Parameters['id']);

		if($this->PortletRecord)
		{
			$this->ViewContentText->Text	= $this->PortletRecord->content;
			$this->pnlHTMLPortlet->CssClass	= $this->PortletRecord->css;
		}
	}

	public function SearchQuery($queryvalue)
	{
		return "select tblpagecontent.pagename,tblhtmlportlet.content as text from tblpagecontent, tblhtmlportlet where tblpagecontent.id=tblhtmlportlet.id && tblhtmlportlet.content like '%$queryvalue%'";
	}
}
?>